<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>推荐列表详细信息</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv="Cache-Control" content="no-transform">
		<meta name="format-detection" content="telephone=no">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<link rel="stylesheet" href="style/css/basic.css" />
		<link rel="stylesheet" href="style/css/recommend_info.css" />
		<script type="text/javascript" src="style/plugin/mui/js/mui.min.js"></script>
		<script type="text/javascript" src="style/js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript" src="style/plugin/swiper/js/swiper.min.js"></script>
		<script type="text/javascript" src="style/js/vue.min.js"></script>
		<script type="text/javascript" src="style/js/vue-resource.js"></script>
		<script type="text/javascript" src="style/js/md5.js"></script>
		<script type="text/javascript" src="style/js/basic.js"></script>
	</head>
	<body>
		<div id="rec_info">
		    <div id="header" style="background: linear-gradient(to left, #2F80ED, #56CCF2);color: #fff;">
				<h1>推荐列表详细信息</h1>
				<span class="backicon"></span>
			</div>
			<div class="body recommend_list_info">
				<div class="person_info">
					<span>姓名：{{recInfo.name}}</span>  
					<span>电话：{{recInfo.phone}}</span>
				</div>
				<div>
					<ul class="order">
						<li>
							代理人：<em>{{recInfo.agent_no.nickname}}</em>
						</li>
						<li>
							电话：<em>{{recInfo.agent_no.phone}}</em>
						</li>
						<li>
							用酒时间：<em>{{fTime(recInfo.use_time)}}</em>
						</li>
						<li>
							用酒类型：<em>{{recInfo.use_scene}}</em>
						</li>
					</ul>				
				</div>
				<div v-for="(ord,index) in orderList" v-if="orderList!=''">
					<ul class="order">
						<li>
							订单编号：<em>{{ord.order_no}}</em>
						</li>
						<li>
							订单总价：<em>￥{{ord.price}}</em>
						</li>
						<li>
							购买数量：<em>{{ord.num}}</em>
						</li>
					</ul>				
				</div>
			</div>	
		</div>
		<script>
			new Vue({
				el:"#rec_info",
				data:{
					recInfo:"",
					orderList:""
				},
				methods:{
					fTime:function(timestamp){
	                	if (typeof timestamp == "undefined") {
					        timestamp = Math.round(new Date().getTime() / 1000)
					    }
					    var n = parseInt(timestamp) * 1000
					    var date = new Date(n);
					    var Y = date.getFullYear() + '-';
					    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
					    var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
					    var H=date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
					    var Min=date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
					    var S=date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
					    return (Y + M + D)
	                }
				},
				created:function(){
					var that=this;
					mui.plusReady(function(){
						var self=plus.webview.currentWebview().current;
					    that.$http.post(domain+"/recommend_form/getInfo?t="+that.ticket+"&sign="+that.sign,{
							form_no:self
						},{emulateJSON:true}).then(
				            function (res) {
				                // 处理成功的结果
				                if(res.body.code==1){
				                  console.log(res.body)	
				                  that.recInfo=res.body.data;
                                  that.orderList=res.body.data.order_list;
	//			                  for(var i in res.body.data){
	//			                  	this.flag[i]=true
	//			                  }
				                } 
				            },function (res) {
				            // 处理失败的结果 
				            console.log(res) 
				            }
				        );	
					})
					
				},
				mounted:function(){
					
				}
			})
		</script>
	</body>
</html>
